package de.kieselbach.javafx.builder.factory

import de.kieselbach.javafx.builder.proxy.LeftNode

/*
 * Copyright 2012 by procar informatik AG,
 * Eschenweg 7, 64331 Weiterstadt, Germany
 * All rights reserved.
 */
class LeftBuilderFactory extends AbstractBuilderFactory {

    @Override
    String getName() {

        return 'left'
    }

    @Override
    Class getNodeClass() {

        return LeftNode.class
    }

    @Override
    void nodeCompleted(Object parent, Object child) {

        parent.node = child
    }

    @Override
    def createNode(Object name, Map attributes, Object value) {

        def node = new LeftNode()

        if(attributes != null) {
            attributes.each() {key, val ->
                node[key] = val
            }
        }

        node
    }
}
